﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Common.Attributes;
using Common.Base;
using Common.Enums;
using Microsoft.EntityFrameworkCore;

namespace Model.Entity
{
    /// <summary>
    /// 测试用户
    /// </summary>
    [Table("user_info")]
    [Comment("测试用户")]
    public class UserInfo : BaseEntity
    {
        /// <summary>
        ///     用户名
        /// </summary>
        [Column("user_name")]
        [MaxLength(500)]
        [Comment("用户名")]
        public string UserName { get; set; }

        /// <summary>
        ///     密码
        /// </summary>
        [Column("password")]
        [MaxLength(500)]
        [Comment("密码")]
        public string Password { get; set; }

        /// <summary>
        ///     年龄
        /// </summary>
        [Column("age")]
        [Comment("年龄")]
        [ExtJson(Code = "字典编码自动扩展")]
        public int? Age { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Column("sex")]
        [Comment("性别")]
        [ExtJson(Type = ExtJsonEnum.Enums, EnumType = typeof(SexEnum))]
        public SexEnum? Sex { get; set; }

        /// <summary>
        /// 余额
        /// </summary>
        [Column("money", TypeName = "decimal(18, 2)")]
        [Comment("余额")]
        public decimal? Money { get; set; }
    }
}